-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various CoDICE L1 Updates #711
Various CoDICE L1 Updates #711
Conversation
…how science datasets are created
CATDESC: "" | ||
DISPLAY_TYPE: no_plot | ||
FIELDNAM: "" | ||
FILLVAL: -9223372036854775808 | ||
FORMAT: I12 | ||
LABLAXIS: "" | ||
REFERENCE_POSITION: "" | ||
RESOLUTION: "" | ||
SCALETYP: linear | ||
TIME_BASE: "" | ||
TIME_SCALE: "" | ||
UNITS: dN | ||
VALIDMIN: -9223372036854775808 | ||
VALIDMAX: 9223372036854775807 | ||
VAR_TYPE: data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just to have consistent indenting across the file.
DISPLAY_TYPE: "" | ||
FIELDNAM: Energy step | ||
FILLVAL: "" | ||
FORMAT: A3 | ||
LABLAXIS: "" | ||
REFERENCE_POSITION: "" | ||
RESOLUTION: "" | ||
TIME_BASE: "" | ||
TIME_SCALE: "" | ||
UNITS: "" | ||
VALIDMAX: "" | ||
VALIDMIN: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that I needed to add these in order to pass the new check here:
# Validating required schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is that a bug in the validation code? Based on the schema YAML here, I wouldn't expect all of these additions to be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am understanding correctly, this is checking against whatever is defined as "required" in the default_variable_cdf_attrs_schema.yaml
file. It loos like all of these are indeed required according to this file, for example TIME_BASE
:
attribute_key:
# ===== EPOCH-ONLY VARIABLE ATTRIBUTES =====
TIME_BASE:
description: >
fixed (0AD, 1900, 1970 (POSIX), J2000 (used by CDF_TIME_TT2000),
4714 BC (Julian)) or flexible (provider-defined)
required: true # NOT Required in ISTP Guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I am wondering if it should only be checking what is required and is present in the list of attributes defined for the datatype. Not important to this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on slack convos, sounds like Maxine will fix this eventually. I will hang tight on merging this PR and update accordingly when the fix is in.
imap_processing/codice/packet_definitions/P_COD_HI_INST_COUNTS_AGGREGATED.xml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly looks good to me. I didn't review the XTCE changes.
DISPLAY_TYPE: "" | ||
FIELDNAM: Energy step | ||
FILLVAL: "" | ||
FORMAT: A3 | ||
LABLAXIS: "" | ||
REFERENCE_POSITION: "" | ||
RESOLUTION: "" | ||
TIME_BASE: "" | ||
TIME_SCALE: "" | ||
UNITS: "" | ||
VALIDMAX: "" | ||
VALIDMIN: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is that a bug in the validation code? Based on the schema YAML here, I wouldn't expect all of these additions to be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments is all. There are a lot of refactor things going on, but no new processing from what I could tell. If you could break up the yaml/metadata additions and code refactor in future PRs I think that would be helpful too.
I am hopeful that going to a combined XTCE with dynamic variable length and starting from the xarray datasets will be helpful for you here.
Note that we aren't including the short/long description in the housekeeping datasets automatically and planning on using yaml configuration files for all metadata.
See this thread for more discussion: #687 (comment)
|
||
# Write the dataset to a CDF so it can be manually inspected as well | ||
file_path = write_cdf(dataset) | ||
print(f"CDF file written to {file_path}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(f"CDF file written to {file_path}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose I should change this to a logging
statement. I like to have this path printed so that I can copy over the resulting CDF in case I want to manually inspect it.
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
…g into codice-l1-updates
I added a |
pre-commit.ci autofix |
Change Summary
Overview
This PR contains various updates to the CoDICE L1 algorithm, mainly to clean some things up, add support for
lo-pha
andhi-pha
data products (event data), and changes required to get recently-acquired simulated data working in the pipeline.Updated Files
imap_processing/cdf/config/imap_codice_global_cdf_attrs.yaml
imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml
imap_processing/cdf/config/imap_codice_l1b_variable_attrs.yaml
imap_processing/codice/codice_l0.py
imap_processing/codice/codice_l1a.py
imap_processing/codice/constants.py
imap_processing/codice/packet_definitions/*.xml
space_packet_parser
and updates packet definition spreadsheetimap_processing/codice/utils.py
create_hskp_dataset
tocodice_l1a.py
to be consistent with where the code to create other datasets residesimap_processing/tests/codice/data/imap_codice_l0_*.pkts
imap_processing/tests/codice/test_codice_l0.py
hskp
to be consistent with naming conventionimap_processing/tests/codice/test_codice_*.py